home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Your Choice 3
/
Your Choice Software Collection 3.iso
/
os2
/
lbasic06
/
factoril.bas
< prev
next >
Wrap
BASIC Source File
|
1993-11-22
|
436b
|
26 lines
'this program computes a factorial for a keyboard entered
'number and displays the result
input "Please enter a number>"; entry
result = 1
[recurringLoop]
counter = counter + 1
if counter > entry then [skip]
result = result * counter
gosub [recurringLoop]
[skip]
entry = entry - 1
if entry = 1 then [end]
return
[end]
print "The factorial is: "; result